# # 创建元组
# a = ()
# print(type(a))
# b = tuple()
# print(type(b))

# 创建元组时,指定初始值
# a = (1, 2, 3, 4, 5)
# print(a)

# # 创建元组时,也可以是任意类型
# a = (1, 3.7, "hello", True)
# print(a)

# # 通过下标来访问元组的元素,下标从0开始到len - 1 结束
# a = (1, 2, 3, 4, 5)
# print(a[0])
# print(a[::])
# print(a[:])
# print(a[:2])
# print(a[:2:2])
# print(a[-1::-1])

# 遍历元组
# nums = (1, 3, 4, 5, 6)
# for a in nums:
#     print(a)
#
# while a < len(nums):
#     print(nums[a])
#
#
# for a in range(0, len(nums)):
#     print(nums[a])

# # 查找元素
# a = (1, 2, 3, 4, 5)
# # 查找元素在元组中的下标
# print(a.index(2))
# # 查找元素是否在元组内
# print(4 in a)

# 字符串拼接
a = (1, 2, 3, 4, 5)
b = (6, 7, 8, 9, 0)
print(a + b)

# 元组无法进行修改 增加 append拼接 -error
# a.insert(2, "Hello")
# a.pop()
# a.append(2)




# 函数返回多个值时,其返回类型就是元组
# def fuc():
#     x = 2
#     y = 4
#     return x, y
#
#
# print(type(fuc()))
